﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using PlugNT.Cms.Page;

namespace PlugNT.Cms.Web.Admin
{
    public partial class UploadImage : AdminPage
    {
        private static string waterpath = "null";
        protected void Page_Load(object sender, EventArgs e)
        {
            //权限检测
            this.CheckPower();

            //后台代码中赋值了前台代码就不要赋值了。
            uploadimgae.UploadPath ="/"+ PlugNT.Custom.WebConfig.UploadPath.Trim().Trim('/');    
            if (waterpath == "null")
            {
                waterpath = Server.MapPath(PlugNT.Custom.WebConfig.WaterImagePath);
            }
            uploadimgae.WaterPath = waterpath;
            string isall = Request.QueryString["a"] == null ? "" : Request.QueryString["a"].Trim();
            string sheight = Request.QueryString["h"] == null ? "" : Request.QueryString["h"].Trim()+"px";
            string ctype = Request.QueryString["t"] == null ? "" : Request.QueryString["t"].Trim();
            string objstring=Request.QueryString["s"] == null ? "" : Request.QueryString["s"].Trim();
            uploadimgae.IsFullScreen = isall;
            uploadimgae.ScreenHeight = sheight;
            uploadimgae.ClientObjectType = ctype;
            uploadimgae.ClientObjectString = objstring;
        }

        protected void uploadimgae_UploadChanged(object sender, EventArgs e)
        {
            //this.Response.Write("<script language=\"javascript\">alert('图片已上传！');</script>");
        }
    }
}
